<script setup lang="ts">
import {ref,reactive,shallowRef,shallowReactive,watch} from "vue"

//defineEmits函数定义自定义事件给父组件，子组件给父组件传参
const reset= defineEmits(["reset","reset2"])
function goReset(){
  reset("reset2",6)
}
</script>

<template>
  <div>
    <div>我是子组件</div>
    <!-- 模板中可以直接简写 -->
    <button @click="$emit('reset',2)">1.重置app.vue父组件的值</button>
    <button @click="goReset">2.重置app.vue父组件的值</button>
  </div>
</template>

<style scoped>

</style>
